using UnityEngine;

public class UIShopItem : MonoBehaviour
{
	public UILabel price;

	public new UILabel name;

	public UISprite sprite;

	public UISprite cash;

	public UISprite coin;

	public GameObject priceObject;

	public void SetShopItem(StoreItemsConfig.StoreItem item)
	{
		if (item.cost == 0 || item.IsOwned())
		{
			priceObject.SetActive(false);
		}
		else
		{
			priceObject.SetActive(true);
			UITools.ChangeText(price, item.cost.ToString());
			UITools.SetActive(coin, item.currency == CurrencyType.coins);
			UITools.SetActive(cash, item.currency == CurrencyType.ggdollars);
		}
		UITools.ChangeText(name, item.name);
		UITools.ChangeSprite(sprite, item.previewSpriteName);
	}
}
